/**
 * The Ackermann function. 
 */

public class Ackermann
{
	
	private static int ackermann(int m, int n)
	{
		if ( m > 0)
		{
			if ( n == 0)
			{
				return ackermann(m - 1, n);
			}
			if( n > 0)
			{
				return ackermann(m - 1, ackermann(m, n - 1));
			}
		}
		return n + 1;
	}
		
	public static void main(String[] args)
	{
		int sum = ackermann(5,6);
		System.out.println(sum);
	}	
}
